/*
 * imu_process.h
 *
 */
#ifndef __IMU_PROCESS_H_
#define __IMU_PROCESS_H_

#ifdef  __cplusplus
extern "C" {
#endif		/* __cplusplus */
	
#define CAR_STOP_GPS_YES	1
#define CAR_RUN_GPS_YES		2
#define CAR_STOP_GPS_NO		3
#define CAR_RUN_GPS_NO		4
#define CAR_STOP_GPS_BAD	5
#define CAR_RUN_GPS_BAD		6
	
	
typedef struct _IMU_DATA {
    long			    Mx_Bias;
	long				My_Bias;
	long				Magnetometer_Bias_factor;
	unsigned char		checksum;
}IMU_DATA;


void Get_ADXL335_Data(void);
void Get_ADXL345_Data(void);

void MS_Pressure_Task(void);

void MS5607_Get_Pressure(void);
void MS5801_Get_Pressure(void);
void Altitude_Moving_Average(unsigned char num);

void Get_Murata_Data(void);

void F_deNoise_moving_avg(void);
extern double gSmoothing_Hpress;
extern unsigned short gSmoothing_A_335[3];
extern unsigned short gSmoothing_Gy_analog;
extern unsigned short gSmoothing_Gz_analog;
extern double gSmoothing_M_5883[3];
extern unsigned short gSmoothing_A45x;
extern unsigned short gSmoothing_A45y;
extern double gSmoothing_A_345[3];
extern double gSmoothing_L3G[3];
extern double gSmoothing_Heading_by_Magnetometer;


extern unsigned char pFlat_state_from_gyro;
extern double pGyro_sd_queue_avg;
extern double pGyro_sd_queue_sd;
void Pross_Gyro_sd(void);

extern double pHigh_sd_queue_avg;
extern double pHigh_sd_queue_sd;
void Pross_High_sd(void);

void Get_Magnetometer_Bias_Task(void);

void Imu_Param_Write(int id);
void Imu_Param_Set(void);
void Mxy2Azimuth(void);
void Azimuth_By_Mang_and_Gyro_Task(void);

void GetAngle_by_SH(void);
void InitHeading_by_Murata(double gps_heading);
double GetHeading_by_GyroAndMagn(int mgz, double mazimuth);

#ifdef __cplusplus
}
#endif	/* __cplusplus */
#endif	/* __IMU_PROCESS_H_ */